package com.clound.product.common.utils;


import com.google.gson.Gson;

/**
 * Created by zzy on 2018/1/30.
 */
public class JsonUtil {

    public static <T> String Object2Json(T obejct){
        Gson gson = new Gson();
        String json = gson.toJson(obejct);
        return json;
    }

    public static <T> T Json2Object(String json,Class<T> type){
        Gson gson = new Gson();
        T result=gson.fromJson(json,type);
        return result;
    }
}
